<?php
/**
 * membermsg controller
 * @package app-member_cmd
 */
load_lib('/cmd/controller');
/**
 * membermsg controller
 * @author pandajingjing
 * @package app-member_cmd
 */
class membermsgcontroller extends cmd_controller{
	
	/**
	 * 入口方法
	 */
	function doRequest(){
		load_lib('/bll/member/task');
		$clsBll=new bll_member_task();
		self::calTime('Consume Message');
		$intMsgCnt=$clsBll->doMemberMsg();
		self::stdOut('Messae Count: '.$intMsgCnt);
		$floSpendTime=self::calTime('Consume Message');
        if($intMsgCnt>0){
		    $floEachTime=$floSpendTime/$intMsgCnt;
		    $intSleepTime=0;
        }else{
            $floEachTime=0;
            $intSleepTime=10;
        }
		self::stdOut('Each Messae Time: '.$floEachTime);
		sleep($intSleepTime);
	}
}